<template>
  <div>我是第一层路由Home组件, 用户名: {{ userStore.username }}</div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue';
import useUserStore from '@/store/modules/user'

let userStore = useUserStore()

// 在主页刚挂载时，请求api获取用户信息
onMounted(() => {
   userStore.userInfo()
})
</script>

<style scoped lang="scss"></style>
